package com.txw.javaCore.server.session;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @PROJECT_NAME: JavaCoreB2
 * @DESCRIPTION: 用户会话session条件装配 -redis
 * @Author: 涂玄武
 * @DATE: 2021/2/25 9:54
 */
public class SessonConditionRedis implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        Environment env = context.getEnvironment();
        return env.getProperty("session.redis.enable",Boolean.class);
    }
}
